<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>cocoOS: C:/Users/peter_000/Desktop/cocoOS/common/src/os_task.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">cocoOS
   &#160;<span id="projectnumber">5.0.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('os__task_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">os_task.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;cocoos.h&quot;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtcb.html">tcb</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8d616e4adf7d073f7340e685df26f64e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a8d616e4adf7d073f7340e685df26f64e">os_task_init</a> (void)</td></tr>
<tr class="separator:a8d616e4adf7d073f7340e685df26f64e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af531a501491c2acab61a65c8741e1375"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#af531a501491c2acab61a65c8741e1375">task_create</a> (taskproctype taskproc, void *data, uint8_t prio, Msg_t *msgPool, uint8_t poolSize, uint16_t msgSize)</td></tr>
<tr class="separator:af531a501491c2acab61a65c8741e1375"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a250fb484aede328b860ec5661fec2ee4"><td class="memItemLeft" align="right" valign="top">TaskState_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a250fb484aede328b860ec5661fec2ee4">task_state_get</a> (uint8_t tid)</td></tr>
<tr class="separator:a250fb484aede328b860ec5661fec2ee4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac98b20fb840196c24a41c72ae03cfe5f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#ac98b20fb840196c24a41c72ae03cfe5f">task_kill</a> (uint8_t tid)</td></tr>
<tr class="separator:ac98b20fb840196c24a41c72ae03cfe5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61293c64d8794582ff89ca7c27ba7d7d"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a61293c64d8794582ff89ca7c27ba7d7d">task_get_data</a> ()</td></tr>
<tr class="separator:a61293c64d8794582ff89ca7c27ba7d7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af75c60a5ad4a7270fd7e6eb6af5b20c9"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#af75c60a5ad4a7270fd7e6eb6af5b20c9">os_task_highest_prio_ready_task</a> (void)</td></tr>
<tr class="separator:af75c60a5ad4a7270fd7e6eb6af5b20c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04962ad755ad9576683a4a763c7a560e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a04962ad755ad9576683a4a763c7a560e">os_task_next_ready_task</a> (void)</td></tr>
<tr class="separator:a04962ad755ad9576683a4a763c7a560e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf1a8f205d9d786466871bf48771d1ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#aaf1a8f205d9d786466871bf48771d1ee">os_task_release_waiting_task</a> (Sem_t sem)</td></tr>
<tr class="separator:aaf1a8f205d9d786466871bf48771d1ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a792a666d04e4cd5b9a552e5d9337902e"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a792a666d04e4cd5b9a552e5d9337902e">os_task_waiting_this_semaphore</a> (Sem_t sem)</td></tr>
<tr class="separator:a792a666d04e4cd5b9a552e5d9337902e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a10b472f58a8975ee67e1be89b50aa13b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a10b472f58a8975ee67e1be89b50aa13b">os_task_wait_sem_set</a> (uint8_t tid, Sem_t sem)</td></tr>
<tr class="separator:a10b472f58a8975ee67e1be89b50aa13b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65269bf7cd04bdc3ae2e2c42adcb63bb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a65269bf7cd04bdc3ae2e2c42adcb63bb">os_task_ready_set</a> (uint8_t tid)</td></tr>
<tr class="separator:a65269bf7cd04bdc3ae2e2c42adcb63bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa62bd39bebc1f86104be4115cd28cd7d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#aa62bd39bebc1f86104be4115cd28cd7d">os_task_suspend</a> (uint8_t tid)</td></tr>
<tr class="separator:aa62bd39bebc1f86104be4115cd28cd7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ab66ca1fc68d28f0223fa9c87f4501c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a1ab66ca1fc68d28f0223fa9c87f4501c">os_task_resume</a> (uint8_t tid)</td></tr>
<tr class="separator:a1ab66ca1fc68d28f0223fa9c87f4501c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac41b58e8f26d6dd0768da67c930b5541"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#ac41b58e8f26d6dd0768da67c930b5541">os_task_kill</a> (uint8_t tid)</td></tr>
<tr class="separator:ac41b58e8f26d6dd0768da67c930b5541"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04f59990ebca61c1d36f513e1dd7fca1"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a04f59990ebca61c1d36f513e1dd7fca1">os_task_prio_get</a> (uint8_t tid)</td></tr>
<tr class="separator:a04f59990ebca61c1d36f513e1dd7fca1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66602d4026e7c4416446a0d538eadff5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a66602d4026e7c4416446a0d538eadff5">os_task_clear_wait_queue</a> (uint8_t tid)</td></tr>
<tr class="separator:a66602d4026e7c4416446a0d538eadff5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae157f3165b4d4bb9c0c53759d34582ed"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#ae157f3165b4d4bb9c0c53759d34582ed">os_task_wait_time_set</a> (uint8_t tid, uint8_t id, uint32_t time)</td></tr>
<tr class="separator:ae157f3165b4d4bb9c0c53759d34582ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e664d52d40e433fbf719abd4eb87251"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a7e664d52d40e433fbf719abd4eb87251">os_task_wait_event</a> (uint8_t tid, Evt_t eventId, uint8_t waitSingleEvent, uint32_t timeout)</td></tr>
<tr class="separator:a7e664d52d40e433fbf719abd4eb87251"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a488d4c8070cae310e5aed422ef6a4e90"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a488d4c8070cae310e5aed422ef6a4e90">os_task_tick</a> (uint8_t id, uint32_t tickSize)</td></tr>
<tr class="separator:a488d4c8070cae310e5aed422ef6a4e90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d54b97ef19633d15f7e75985c233cc2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a9d54b97ef19633d15f7e75985c233cc2">os_task_signal_event</a> (Evt_t eventId)</td></tr>
<tr class="separator:a9d54b97ef19633d15f7e75985c233cc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec9fb32d048a8929b7861e7af5217dfc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#aec9fb32d048a8929b7861e7af5217dfc">os_task_run</a> (void)</td></tr>
<tr class="separator:aec9fb32d048a8929b7861e7af5217dfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ca5597ba38bcdc3a0686bcb6c2adc8c"><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a0ca5597ba38bcdc3a0686bcb6c2adc8c">os_task_internal_state_get</a> (uint8_t tid)</td></tr>
<tr class="separator:a0ca5597ba38bcdc3a0686bcb6c2adc8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c3bfda413973850230d6f13c937e589"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a2c3bfda413973850230d6f13c937e589">os_task_internal_state_set</a> (uint8_t tid, uint16_t state)</td></tr>
<tr class="separator:a2c3bfda413973850230d6f13c937e589"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf3b0aee54c108a038455df3de8708d3"><td class="memItemLeft" align="right" valign="top">MsgQ_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#aaf3b0aee54c108a038455df3de8708d3">os_task_msgQ_get</a> (uint8_t tid)</td></tr>
<tr class="separator:aaf3b0aee54c108a038455df3de8708d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abca69347ad5392908a299f90ddbd5543"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#abca69347ad5392908a299f90ddbd5543">os_task_set_wait_queue</a> (uint8_t tid, MsgQ_t queue)</td></tr>
<tr class="separator:abca69347ad5392908a299f90ddbd5543"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a414f7d94e34cb729de2727b43ccdc624"><td class="memItemLeft" align="right" valign="top">MsgQ_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a414f7d94e34cb729de2727b43ccdc624">os_task_get_wait_queue</a> (uint8_t tid)</td></tr>
<tr class="separator:a414f7d94e34cb729de2727b43ccdc624"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d9212f27d92c4b4b7b0c3de402d801b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a3d9212f27d92c4b4b7b0c3de402d801b">os_task_set_change_event</a> (uint8_t tid, Evt_t event)</td></tr>
<tr class="separator:a3d9212f27d92c4b4b7b0c3de402d801b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19a1e0bf53e7f8bc96c232acce393318"><td class="memItemLeft" align="right" valign="top">Evt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a19a1e0bf53e7f8bc96c232acce393318">os_task_get_change_event</a> (uint8_t tid)</td></tr>
<tr class="separator:a19a1e0bf53e7f8bc96c232acce393318"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9b46ac5274873f7e22d4828f69c8dc33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#a9b46ac5274873f7e22d4828f69c8dc33">os_task_set_msg_result</a> (uint8_t tid, uint8_t result)</td></tr>
<tr class="separator:a9b46ac5274873f7e22d4828f69c8dc33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb7a8ccf24b2838a671b38458e66f35f"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#afb7a8ccf24b2838a671b38458e66f35f">os_task_get_msg_result</a> (uint8_t tid)</td></tr>
<tr class="separator:afb7a8ccf24b2838a671b38458e66f35f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af221407980714d1915a59a3e82c79bca"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="os__task_8c.html#af221407980714d1915a59a3e82c79bca">os_task_timeout_get</a> (uint8_t tid)</td></tr>
<tr class="separator:af221407980714d1915a59a3e82c79bca"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a66602d4026e7c4416446a0d538eadff5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_clear_wait_queue </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a19a1e0bf53e7f8bc96c232acce393318"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Evt_t os_task_get_change_event </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="afb7a8ccf24b2838a671b38458e66f35f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t os_task_get_msg_result </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a414f7d94e34cb729de2727b43ccdc624"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MsgQ_t os_task_get_wait_queue </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af75c60a5ad4a7270fd7e6eb6af5b20c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t os_task_highest_prio_ready_task </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a8d616e4adf7d073f7340e685df26f64e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a0ca5597ba38bcdc3a0686bcb6c2adc8c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t os_task_internal_state_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a2c3bfda413973850230d6f13c937e589"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_internal_state_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ac41b58e8f26d6dd0768da67c930b5541"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_kill </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aaf3b0aee54c108a038455df3de8708d3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">MsgQ_t os_task_msgQ_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a04962ad755ad9576683a4a763c7a560e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t os_task_next_ready_task </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a04f59990ebca61c1d36f513e1dd7fca1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t os_task_prio_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a65269bf7cd04bdc3ae2e2c42adcb63bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_ready_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aaf1a8f205d9d786466871bf48771d1ee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_release_waiting_task </td>
          <td>(</td>
          <td class="paramtype">Sem_t&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a1ab66ca1fc68d28f0223fa9c87f4501c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_resume </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aec9fb32d048a8929b7861e7af5217dfc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_run </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a3d9212f27d92c4b4b7b0c3de402d801b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_set_change_event </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Evt_t&#160;</td>
          <td class="paramname"><em>event</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9b46ac5274873f7e22d4828f69c8dc33"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_set_msg_result </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>result</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="abca69347ad5392908a299f90ddbd5543"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_set_wait_queue </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">MsgQ_t&#160;</td>
          <td class="paramname"><em>queue</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a9d54b97ef19633d15f7e75985c233cc2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_signal_event </td>
          <td>(</td>
          <td class="paramtype">Evt_t&#160;</td>
          <td class="paramname"><em>eventId</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="aa62bd39bebc1f86104be4115cd28cd7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_suspend </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a488d4c8070cae310e5aed422ef6a4e90"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_tick </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>tickSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af221407980714d1915a59a3e82c79bca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t os_task_timeout_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a7e664d52d40e433fbf719abd4eb87251"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_wait_event </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Evt_t&#160;</td>
          <td class="paramname"><em>eventId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>waitSingleEvent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a10b472f58a8975ee67e1be89b50aa13b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_wait_sem_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Sem_t&#160;</td>
          <td class="paramname"><em>sem</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ae157f3165b4d4bb9c0c53759d34582ed"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void os_task_wait_time_set </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a792a666d04e4cd5b9a552e5d9337902e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t os_task_waiting_this_semaphore </td>
          <td>(</td>
          <td class="paramtype">Sem_t&#160;</td>
          <td class="paramname"><em>sem</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="af531a501491c2acab61a65c8741e1375"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t task_create </td>
          <td>(</td>
          <td class="paramtype">taskproctype&#160;</td>
          <td class="paramname"><em>taskproc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>prio</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Msg_t *&#160;</td>
          <td class="paramname"><em>msgPool</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>poolSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>msgSize</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Creates a task scheduled by the os. The task is put in the ready state.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">taskproc</td><td>Function pointer to the task procedure. </td></tr>
    <tr><td class="paramname">data</td><td>[optional] Pointer to task data </td></tr>
    <tr><td class="paramname">prio</td><td>Task priority on a scale 0-255 where 0 is the highest priority. </td></tr>
    <tr><td class="paramname">msgPool</td><td>[optional] Pointer to the message pool, containing messages. Ignored if poolSize is 0. </td></tr>
    <tr><td class="paramname">poolSize</td><td>[optional] Size, in nr of messages, of the message pool. Set to 0 if no message pool needed for the task </td></tr>
    <tr><td class="paramname">msgSize</td><td>[optional] Size of the message type held in the message queue </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Task id of the created task.</dd></dl>
<dl class="section remark"><dt>Remarks</dt><dd><b>Usage:</b> <br />
 Should be called early in system setup, before starting the task execution. Only one task per priority level is allowed.</dd></dl>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;    static uint8_t taskId;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;    static Msg_t msgpool_1[ POOL_SIZE ];</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;int main(void) {</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;    system_init();</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;    os_init();</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    taskId = task_create( myTaskProc, 0, 1, msgpool_1, POOL_SIZE, sizeof(Msg_t) );</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;    ...</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a61293c64d8794582ff89ca7c27ba7d7d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* task_get_data </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Gets a pointer to the data structure associated with the task</p>
<dl class="section return"><dt>Returns</dt><dd>pointer to task data</dd></dl>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;static uint32_t taskData;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;static void taskProc(void)</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;{</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;  task_open();</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;  for (;;) {</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    task_wait( 100 );</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;    uint32_t *data = (uint32_t*)task_get_data();</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    *data++;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;  }</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;  task_close();</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;}</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;int main() {</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;   ...</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;   task_create(taskProc, (void*)&amp;taskData, ...);</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;   ...</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ac98b20fb840196c24a41c72ae03cfe5f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void task_kill </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Puts the task associated with the specified id in the killed state. A killed task, cannot be resumed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">task_id</td><td>id of the task. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;static uint8_t taskId;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;static void waitingTask(void)</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;{</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;    task_open();</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;    event_wait( event );</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    if ( event_signaling_taskId_get( event ) == taskId ) {</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;        task_kill( taskId );</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    }</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    task_close();</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;}</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;static void signalingTask1(void)</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;{</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    task_open();    </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    task_wait( 900 );</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;       </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;    event_signal(event);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;    task_close();</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;}</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;int main() {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;   ...</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;   taskId = task_create(signalingTask1, ...);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;   ...</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;}</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a250fb484aede328b860ec5661fec2ee4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TaskState_t task_state_get </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>tid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_4e4d22e38ca4e2e8207825ee2d00bc54.html">src</a></li><li class="navelem"><a class="el" href="os__task_8c.html">os_task.c</a></li>
    <li class="footer">Generated on Tue Aug 28 2018 17:58:06 for cocoOS by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
